/* ******* Orange Rotations ******** */

void o1(struct aCube * cube) {
	o1c( cube );
	o1e( cube );
}

void o2(struct aCube * cube) {
	o2c( cube );
	o2e( cube );
}

void o3(struct aCube * cube) {
	o3c( cube );
	o3e( cube );
}

void o1c(struct aCube * cube) {

	short temp = cube[C6].o;
	cube[C6].o = cube[C8].o;
	cube[C8].o = cube[C1].o;
	cube[C1].o = cube[C2].o;
	cube[C2].o = temp;

	temp = cube[C6].b;
	cube[C6].b = cube[C8].y;
	cube[C8].y = cube[C1].g;
	cube[C1].g = cube[C2].w;
	cube[C2].w = temp;

	temp = cube[C6].y; 
	cube[C6].y = cube[C8].g;
	cube[C8].g = cube[C1].w;
	cube[C1].w = cube[C2].b;
	cube[C2].b = temp;

        temp = cube[C6].pos;
        cube[C6].pos = cube[C8].pos;
        cube[C8].pos = cube[C1].pos;
        cube[C1].pos = cube[C2].pos;
        cube[C2].pos = temp;
}

void o1e(struct aCube * cube) {

	short temp = cube[E19].o;
	cube[E19].o = cube[E14].o;
	cube[E14].o = cube[E20].o;
	cube[E20].o = cube[E9].o;
	cube[E9].o = temp;
  
	temp = cube[E19].b;
	cube[E19].b = cube[E14].y;
	cube[E14].y = cube[E20].g;
	cube[E20].g = cube[E9].w;
	cube[E9].w = temp;

        temp = cube[E19].pos;
        cube[E19].pos = cube[E14].pos;
        cube[E14].pos = cube[E20].pos;
        cube[E20].pos = cube[E9].pos;
        cube[E9].pos = temp;
}

void o2c(struct aCube * cube) {

	short temp = cube[C6].o;
	cube[C6].o = cube[C1].o;
	cube[C1].o = temp;
	temp = cube[C2].o;
	cube[C2].o = cube[C8].o;
	cube[C8].o = temp;

	temp = cube[C6].b;
	cube[C6].b = cube[C1].g;
	cube[C1].g = temp;
	temp = cube[C6].y;
	cube[C6].y = cube[C1].w;
	cube[C1].w = temp;

	temp = cube[C2].b;
	cube[C2].b = cube[C8].g;
	cube[C8].g = temp;
	temp = cube[C2].w;
	cube[C2].w = cube[C8].y;
	cube[C8].y = temp;

        temp = cube[C6].pos;
        cube[C6].pos = cube[C1].pos;
        cube[C1].pos = temp;
        temp = cube[C2].pos;
        cube[C2].pos = cube[C8].pos;
        cube[C8].pos = temp;
}

void o2e(struct aCube * cube) {

	short temp = cube[E19].o;
	cube[E19].o = cube[E20].o;
	cube[E20].o = temp;
	temp = cube[E14].o;
	cube[E14].o = cube[E9].o;
	cube[E9].o = temp;

	temp = cube[E19].b;
	cube[E19].b = cube[E20].g;
	cube[E20].g = temp;
	temp = cube[E14].y;
	cube[E14].y = cube[E9].w;
	cube[E9].w = temp;

        temp = cube[E19].pos;
        cube[E19].pos = cube[E20].pos;
        cube[E20].pos = temp;
        temp = cube[E14].pos;
        cube[E14].pos = cube[E9].pos;
        cube[E9].pos = temp;
}

void o3c(struct aCube * cube) {

	short temp = cube[C6].o;
	cube[C6].o = cube[C2].o;
	cube[C2].o = cube[C1].o;
	cube[C1].o = cube[C8].o;
	cube[C8].o = temp;

	temp = cube[C6].b;
	cube[C6].b = cube[C2].w;
	cube[C2].w = cube[C1].g; 
	cube[C1].g = cube[C8].y;
	cube[C8].y = temp;

	temp = cube[C6].y;
	cube[C6].y = cube[C2].b; 
	cube[C2].b = cube[C1].w;
	cube[C1].w = cube[C8].g;
	cube[C8].g = temp;

        temp = cube[C6].pos;
        cube[C6].pos = cube[C2].pos;
        cube[C2].pos = cube[C1].pos;
        cube[C1].pos = cube[C8].pos;
        cube[C8].pos = temp;
}

void o3e(struct aCube * cube) {

	short temp = cube[E19].o;
	cube[E19].o = cube[E9].o;
	cube[E9].o  = cube[E20].o;
	cube[E20].o = cube[E14].o;
	cube[E14].o = temp;

	temp = cube[E19].b;
	cube[E19].b = cube[E9].w;
	cube[E9].w  = cube[E20].g;
	cube[E20].g  = cube[E14].y;
	cube[E14].y =temp;

        temp = cube[E19].pos;
        cube[E19].pos = cube[E9].pos;
        cube[E9].pos = cube[E20].pos;
        cube[E20].pos = cube[E14].pos;
        cube[E14].pos = temp;
}
